//
//  UIView+Helper.h
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.
//

#import <UIKit/UIKit.h>


//一个UIView的相应取值

/**
 *
 *一个UIView的最左边（minX）、最右边（maxX）、最上边（minY）、最下边（maxY）、宽度（width）、高度（height）、中间值（midX、midY）的取值
 * 
 *方便页面构建时取值高宽度用
 *
 **/


@interface UIView (Helper)

@property (nonatomic, assign, readonly, getter=getMinY) CGFloat minY;

@property (nonatomic, assign, readonly, getter=getMidY) CGFloat midY;

@property (nonatomic, assign, readonly, getter=getMaxY) CGFloat maxY;

@property (nonatomic, assign, readonly, getter=getMinX) CGFloat minX;

@property (nonatomic, assign, readonly, getter=getMidX) CGFloat midX;

@property (nonatomic, assign, readonly, getter=getMaxX) CGFloat maxX;

@property (nonatomic, assign, readonly, getter=getWidth) CGFloat width;

@property (nonatomic, assign, readonly, getter=getHeight) CGFloat height;


@property (nonatomic, assign) CGFloat bbottom;
@property (nonatomic, assign) CGFloat rright;

- (BOOL)intersectWithView:(UIView *)view;

+ (instancetype)dc_viewFromXib;

- (BOOL)isShowingOnKeyWindow;


//获取到当前控制器viewController的方法
- (UIViewController *)findCurrentViewController;



/**
 *  无损截图
 *
 *  This function may be called from any thread of your app.
 *
 *  @return 返回生成的图片
 */
- (UIImage *)screenShot;

@end
